<template>
  <div>
    <div>
      为action方法添加防抖功能
    </div>
    <div>用户信息：{{user}}</div>
    <button @click="handleClick">改变问候语</button>
  </div>
</template>
<script setup lang="ts">
import {useCounterStore,IUser} from '@/stores/counter'
import {storeToRefs} from 'pinia'
const counterStore = useCounterStore()
const {user,getUserInfoByRegister,increment} = storeToRefs(counterStore) // getUserInfoByRegister,increment都是undefined
// const {user} = storeToRefs(counterStore)
console.log('getUserInfoByRegister',getUserInfoByRegister,counterStore.getUserInfoByRegister,increment)
function handleClick(){
  counterStore.getUserInfoByRegister('admin','123456')
  // counterStore.increment()
}
</script>